package com.myzl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 事件级别(1低 2中 3高)
 *
 * @author myzl
 */
@Getter
@AllArgsConstructor
public enum AlarmLevel {

    /** 低 */
    LOW("1", "低"),
    /** 中 */
    MIDDLE("2", "中"),
    /** 高 */
    HIGH("3", "已处理");

    private final String code;
    private final String info;

    public static String getNextCode(String code){
        AlarmLevel[] alarmLevels = values();
        for (int i = 0; i < alarmLevels.length; i++) {
            if (code.equals(alarmLevels[i].code) && i+1 < alarmLevels.length ) {
                return alarmLevels[i+1].code;
            }
        }
        return AlarmLevel.HIGH.code;
    }
}
